home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 17540 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.3 KB  |  36 lines

  1. Newsgroups: comp.lang.java,comp.lang.c++
  2. Path: in2.uu.net!allegra!alice!ark
  3. From: ark@research.att.com (Andrew Koenig)
  4. Subject: Re: Will Java kill C++?
  5. Message-ID: <DpyH85.6uu@research.att.com>
  6. Organization: AT&T Research, Murray Hill NJ
  7. References: <4ksfdr$bhh@engnews2.Eng.Sun.COM> <3172DC7C.6B3F@sdt.com> <4ku4lk$lg6@engnews2.Eng.Sun.COM>
  8. Date: Tue, 16 Apr 1996 12:55:17 GMT
  9.  
  10. In article <4ku4lk$lg6@engnews2.Eng.Sun.COM> linden@positive.Sun.COM (Peter van der Linden) writes:
  11.  
  12. > >How would you have maintained C-style linkage and C++ typesafe
  13. > >linkage in the same object module without changing the linker?
  14.  
  15. > By writing a linker pre-pass program which checks for and enforces
  16. > the type-safe linking rules.
  17.  
  18. But such a program (a) would have to be rewritten for every machine
  19. to which C++ was ported, and (b) would not solve the problem of what
  20. name to give the linker for overloaded functions with the same name.
  21.  
  22. For example, suppose one translation unit has
  23.  
  24.     void f(int) { /* ... */ }
  25.  
  26. and another has
  27.  
  28.     void f(double) { /* ... */ }
  29.  
  30. These two translation units are compiled separately.  When compiling C++
  31. into C, what names should the compiler give to the C versions of these functions
  32. so that your hypothetical prelinker will be able to tell them apart?
  33. -- 
  34.                 --Andrew Koenig
  35.                   ark@research.att.com
  36.